This note type displays the children notes on a geographical map, based on an attribute. It is also possible to add new notes at a specific location using the built-in interface.
.gpx files.Starting with v0.105.0, the geomap uses MapLibre GL which requires WebGL v1 support. In general, most devices will support it because browsers/Electron can render it in software if needed.
If the map could not be drawn because WebGL could not be initialized, an error message will appear instead of the map (This map can't be drawn because WebGL isn't available…).
The button that shows your location is offered only when Trilium is reached over HTTPS, in the desktop application or in the mobile application. Browsers refuse to share the location of a device with a page served over plain HTTP, so on such a server the button does not appear.
Right click on an existing note in the Note Tree and select Insert child note → Geo Map.
By default the map will be empty and will show the entire world.
The position on the map and the zoom are saved inside the map note and restored when visiting again the note.
A map that has no position saved yet is framed around the markers it contains when you open it, so they are all in view without having to go looking for them. A map that contains no markers shows the whole world instead.
In practice this applies to maps whose markers were added externally, by a script or through ETAPI (REST API). When you add markers yourself you have already moved the map to reach the place you are marking, and that movement saves a position.
Press the Show your location button at the bottom-right of the map, beside the zoom buttons. The first time, the browser or the operating system asks whether Trilium may know where the device is. In the desktop application the operating system's location settings decide.
The map then moves to where the device is and marks it with a blue dot. A lighter circle around the dot shows how accurate the position is: a phone with GPS gives a dot on the street, while a computer located through its network connection can give a circle that covers a neighbourhood. The map follows the dot as it moves, and the button stays pressed while it does.
Dragging the map stops it from following. The dot stays and keeps moving, and pressing the button again brings the map back to it. Pressing the button while the map is following turns the dot off.
Click the dot to see its coordinates in the panel a searched place is shown in. From there the position can be kept as a marker (see Keeping a place as a marker). Clicking the lighter circle around the dot is a click on the map.
If the position cannot be found, a message says so and the button keeps waiting for one; press it again to stop. If you refuse the permission, the button is disabled until the map is opened again. To allow it after all, change the permission for Trilium in the browser or in the system's location settings.
Your position is not stored in the note, and Trilium does not send it anywhere on its own. Moving the map there does what any other pan or zoom does: the tile provider behind the map's style sees the coordinates of the area now on screen. The map does remember where you left it, as it does after any other movement, so a map you have taken to your location opens there the next time.
The search bar at the top-left of the map searches in two places. It always searches the notes that are already on the map. It can also search for places online, but only when you ask it to.
Type in the search bar, and the notes on the map are matched by their
title as you type. Accents are ignored, both in what you type and in the
titles, so zurich finds Zürich Hauptbahnhof. Each word
is searched for on its own, so hotel paris finds Paris Hotel.
Notes without a #geolocation attribute are not offered, since
there would be nowhere to go. Drawn shapes and GPS tracks are offered,
even though they carry no such attribute: selecting one brings the whole
shape or route into view.
If more notes match than the list can show, you are offered the ones closest to the area you are viewing.
Looking up a place sends what you typed to a third-party service. For this reason, it never happens while you type. Instead, the last row of the result list offers the search. That row reads Search online for "…", with the name of the service below it. The search runs only when you press that row or select it with Enter.
Trilium uses Nominatim, the place search run by the OpenStreetMap Foundation. It needs no account and no API key. Its name is shown on every row that belongs to it: the row that offers the search, the row that says a search is running, and the row that reports that nothing was found or that the service could not be reached.
The search prefers the area you are viewing. Places inside the current view are searched for first and listed above the others. If you search for a shop while looking at your own town, you therefore find the branch in that town, and not one with the same name on another continent. The view is always treated as at least 25 km across, so a search made while zoomed into a single street still covers the town around it.
If you type or paste coordinates into the search bar, a Go to row is offered above all the other results. Selecting it moves the map to that exact spot and marks it. You can then keep it as a marker, in the same way you keep a place found by searching.
Points are untitled by default; the corresponding note opens with the default name selected so it can be easily replaced. If the map has a Default Note Title label, the marker is named by that template instead.
The supported forms are:
45.9432, 24.9668. This is what Google
Maps and OpenStreetMap both give you when you ask for the coordinates of
a place, and it is also what the #geolocation attribute holds.geo: link that the map itself offers for a place, through
the Open location action.A pair that is not a place on Earth, such as 1234, 5678, is
not offered.
Results are gathered under headings, and each group is ordered by distance from the middle of the map:
The headings only appear when at least two of the three groups contain something. Every row that has a position shows how far away it is, in kilometres or miles according to your locale. A place found online shows its name on the first line and its address on the second.
Selecting a note already on the map moves to its marker and opens the note beside the map, as clicking the marker would.
Selecting a place found online moves the map to it and marks it with a temporary pin. The pin has a different color from the map's own markers. The map is fitted to the area that the place covers, so a country fills the view, while a house is shown at street level. Some places have a boundary, such as a country, a county or a park. When the service reports one, that boundary is outlined under the pin.
A panel then opens with the place's full address and its coordinates: in the top-right corner on desktop, and at the bottom of the map on mobile, where the top is kept for the search bar and the result counter. Pressing the coordinates copies them to the clipboard.
Press Add as marker in that panel to keep the place. A child note
is created under the map. It takes the name of the place, as well as the
icon, which matches the kind of place it is. Its #geolocation attribute
is already set. The note opens beside the map, so you can edit it straight
away. The temporary pin disappears, because the place is now a marker like
any other.
The button is not offered on a map that cannot be edited, where the panel can still be read.
Press the panel's close button, or the Escape key, to send the place away without keeping it. The pin goes with it.
Once you select a result, a counter appears under the search bar, with a previous and a next button. These buttons move through everything the search offered, in the order it was listed. You can therefore compare several results without opening the list again. Pressing the counter itself moves the map back to the current result, which is useful after you have moved the map away from it.
To create a marker, first navigate to the desired point on the map. Then press the Add marker button at the center-bottom of the map.
Once pressed, the map will enter in the insert mode, as illustrated by the notification. Additionally, a preview of the marker will be shown at the cursor position.
Simply click the point on the map where to place the marker. To cancel, press either the Escape key or press again the Add marker button.
Once clicked, the marker will show up on the map and a popup will show to the right with the title already selected to be changed.
This works for:
When a vector map style is used, the map itself draws the shops, cafés, museums and other places around the area being viewed. Once the map is zoomed in far enough for these to be drawn, they can be clicked:
Places are read from the map data that has already been downloaded, so clicking one does not send anything to the internet.
Some things to keep in mind:
The location of a marker is stored in the #geolocation attribute
of the child notes:
This value can be added manually if needed. The value of the attribute is made up of the latitude and longitude separated by a comma.
Once a marker is set, it can be repositioned using one of the two ways:
After clicking the button to move the marker, click at the desired position on the map to replace it. To cancel the operation, press Escape.
When a marker, a shape, or track is clicked, a popup will open to the right which contains the following information:
#geolocation attribute
(case in which the coordinates have to be manually added back in in order
to get the note to show on the map again).#geoShape attribute.To dismiss the popup:
When a marker is clicked, the map will automatically adjust the viewport so that the marker is still visible with the popup open. The currently selected marker is shown slightly bigger.
It is possible to switch between markers by clicking on them even when the popup view is already open.
Markers can have Internal (reference) links between them and clicking on such a link will automatically adjust the viewport and the popup view to the new note.
It's possible to press the right mouse button to display a contextual menu.
#geolocation attribute (case in which the coordinates
have to be manually added back in in order to get the note to show on the
map again).
The markers will have the same icon as the note.
It's possible to add a custom color to a marker by assigning them a #color attribute
such as #color=green.
This also applies to tracks and shapes.
Searching for the place is usually quicker (see Searching the map above). The steps below remain useful for a coordinate that is already to hand, or for a place the search cannot find.
In a nutshell, create a child note and set the #geolocation attribute
to the coordinates.
The value of the attribute is made up of the latitude and longitude separated by a comma.
#geolocation attribute
of a child note of the map (don't forget to surround the value with a " character).Similarly to the Google Maps approach:
#geolocation attribute
of a child note of the map and then it should be displayed on the map.See the dedicated Drawing shapes page.
Trilium can display GPS tracks on the geo map, in the form of .gpx files.
To add a track, either:
.gpx file inside the geo map in the note
tree.
application/gpx+xml in the File type field.When going back to the map, the track should now be visible.
The starting point of the track will be displayed as a marker, with the
name of the note underneath. The start marker will also respect the icon
and the color of the note. The end marker is displayed with
a distinct icon.
If the track file contains multiple tracks, they will all be displayed as well as markers. Trilium will also split a single track that happens to have non-continuous points.
If the GPX contains waypoints, they will also be displayed, including their names.
When the track is clicked, the entire route is brought into view, as well
as the right popup will indicate details about the track such as distance,
duration and the elevation map. This information is also displayed when
clicking the .gpx note itself.
When clicking on the markers of a track (whether it's the start or stop builtin markers, or custom markers that are part of the track), only that marker is brought into view, as opposed to the entire route.
When a map is read-only all editing features will be disabled such as:
To set a map as read-only, go to Note buttons → Editable → Read-only (on the new layout, or in Basic Properties on the Ribbon for the old layout).
The styling of the map can be adjusted in the Collection Properties or manually
via the #map:style attribute.
The geo map comes with two different types of styles:
The default theme is Versatiles Colorful (vector).
Trilium v0.105.0 introduces a 3D view, courtesy of MapLibre GL. To enter 3D mode, simply press the corresponding button at the bottom-right of the map or press Ctrl and drag across the map.
The buildings will only appear from zoom 14 onwards to avoid lag.
Starting with v0.102.0 it is possible to use custom tile sets, but only in raster format.
To do so, manually set the #map:style label to
the URL of the tile set. For example, to use Esri.NatGeoWorldMap, set the
value to https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}.
Additionally:
{r} placeholder.map:darkStyle label. This attribute also overrides
builtin themes.Custom vector map support is planned, but not yet implemented.
The following options can be configured either via the Collection Properties, by clicking on the settings (Gear icon). Alternatively, each of these options also have a corresponding label that can be set manually.